package com.demo.wormhole.autoconfiguration;

import com.demo.wormhole.autoconfiguration.datasource.WormholeDataSourceAutoConfiguration;
import com.demo.wormhole.autoconfiguration.datasource.mybatis.WormholeMybatisConfiguration;
import com.demo.wormhole.autoconfiguration.fegin.WormholeFeginAutoConfiguration;
import com.demo.wormhole.autoconfiguration.hystrix.WormholeHystrixAutoConfiguration;
import com.demo.wormhole.autoconfiguration.mock.WormholeMockAutoConfiguration;
import com.demo.wormhole.autoconfiguration.mvc.WormholeMVCAutoConfiguration;
import com.demo.wormhole.autoconfiguration.rabbit.WormholeRabbitAutoConfiguration;
import com.demo.wormhole.autoconfiguration.redis.WormholeRedisAutoConfiguration;
import com.demo.wormhole.core.configuration.WormholeIsolationConfiguration;
import com.demo.wormhole.core.configuration.WormholePropertiesConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import({WormholeRedisAutoConfiguration.class,
        WormholeRabbitAutoConfiguration.class,
        WormholeMVCAutoConfiguration.class,
        WormholeHystrixAutoConfiguration.class,
        WormholeFeginAutoConfiguration.class,
        WormholeDataSourceAutoConfiguration.class,
        WormholeMybatisConfiguration.class,
        WormholeMockAutoConfiguration.class})
public class WormholeAutoConfiguration {
    
    @Bean
    @ConditionalOnMissingBean
    public WormholePropertiesConfiguration wormholePropertiesConfiguration() {
        return new WormholePropertiesConfiguration();
    }
    
    @Bean
    @ConditionalOnMissingBean
    public WormholeIsolationConfiguration wormholeIsolationConfiguration() {
        return new WormholeIsolationConfiguration();
    }
    
}
